<!DOCTYPE html>
<?
$conteudo = 1;
$time = time() + (3600 * 24 * 7);
$conteudo = $_COOKIE['cookie_teste'] + 1;
$ip = $_SERVER['REMOTE_ADDR'];
$n_ip .= $ip;
setcookie("cookie_teste", $conteudo, $time);
setcookie("ip", $n_ip, $time);
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?
        foreach ($_SERVER as $chave => $file) {
            echo "<b> $chave :</b>  " . $file . "<br>";
        }

        $info = $_SERVER['HTTP_USER_AGENT'];

        if (strpos($info, "Firefox")) {
            echo "<br>Browser = Firefox";
        } elseif (strpos($info, "MSIE")) {
            echo "<br>Browser = MSIE";
        } elseif (strpos($info, "Chromium")) {
            echo "<br>Browser = Chromium";
        } elseif (strpos($info, "Chrome")) {
            echo "<br>Browser = Chrome";
        } else {
            echo "<br>Browser Desconhecido";
        }

        echo '<br>' . $_SERVER['SERVER_SIGNATURE'];
        echo '<br>' . $_COOKIE['cookie_teste'] . " visitas realizadas ao site";
        echo '<br>' . $_COOKIE['ip'];


        session_start(); //Incia sessão
        $conteudo_sessao = 'Sessao incializada';
        $_SESSION['session'] = $conteudo_sessao;

        if (isset($_SESSION['session'])) {
            echo '<br>Sessao Ativa<br>';
            echo $_SESSION['session'];
        } else {
            echo '<br>Sessao Inativa';
        }

        unset($_SESSION['session']);

        if (isset($_SESSION['session'])) {
            echo '<br>Sessao Ativa<br>';
            echo $_SESSION['session'];
        } else {
            echo '<br>Sessao Inativa';
        }
        ?>
    </body>
</html>
